// import Vue from 'vue'
import store from '@/store'
// 封装自定义指令
// 设置默认图片
// Vue.directive('imgError', {
//   inserted(el, binding) {
//     // 如果图片加载失败,src的值就等于传入的值
//     el.onerror = () => {
//       console.log('加载失败')
//       el.src = binding.value
//     }
//   }
// })

export const imgError = {
  inserted(el, binding) {
    // 如果图片加载失败,src的值就等于传入的值
    el.onerror = () => {
      console.log('头像加载失败')
      el.src = binding.value
    }
  }
}

export const permission = {
  inserted(el, binding) {
    if (store.getters.roles.points.includes(binding.value)) {
      el.remove()
    }
  }
}

export const chicken = {}

